<?php
declare (strict_types=1);

namespace app\command;

use app\admin\controller\api\InformDispose;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class CronWxTpl extends Command
{
    protected function configure()
    {
        $this->setName('CronWxTpl')
            ->setDescription('巡店预警 - 微信模板消息');
    }

    /**
     * @param Input $input
     * @param Output $output
     * @return int|null|void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    protected function execute(Input $input, Output $output)
    {
        $output->writeln('开始发送巡店预警微信模板消息-' . date('Y-m-d H:i:s'));       
        $task = new InformDispose();
        $task->patrol();
        $output->writeln('结束发送巡店预警微信模板消息-' . date('Y-m-d H:i:s'));
    }
}
